This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
There's a function to compare two dates in lotusscript?
Let me explain:
I have two text fields on a web application and I get this dates and make a comparation to run the agent. I know that compare two date- text strings are impossible, so I tried to make it with LSLocalTime.
But I got errors, a lot of them. Could you help me to resolve this pluzze?!
Thanks in advance.
Here is the code:
Use "WorkflowProcedures"
Sub Initialize
MsgBox "Agente MediaDia - Entrou no agente!"
On Error GoTo TrataError
Dim ses As New NotesSession
Dim db As NotesDatabase
Dim vis As NotesView
Dim col As NotesDocumentCollection
Dim doc As NotesDocument
Dim autor As Variant
Dim criacao As Variant
Dim dataHoje As String
Dim total As Long
dataHoje = Format(Now, "mm/dd/yyyy")
MsgBox "Data Hoje: " + CStr(datahoje)
Set Webdoc = ses.DocumentContext
Set db = ses.CurrentDatabase
Set vis = db.GetView("Autores")
Set col = db.Alldocuments
Set doc = col.Getfirstdocument()
'MsgBox "Autor do primeiro documento da colection: " + doc.Authors(0)
total = col.Count
total = 0
While not doc Is nothing
datadoc = doc.Created()
Dim data As New NotesDateTime(dataHoje)
Dim data1 As New NotesDateTime(datadoc)
MsgBox "Data Hoje: " + CStr(dataHoje) + " Data do Doc: " + CStr(datadoc)
If data.LSLocalTime = data1.LSLocalTime Then
'If datadoc = datahoje Then
MsgBox "**************************** Entrou no if *************************"
total = total + 1
End If
MsgBox " Contador: " & total
MsgBox "Data Criação dessa parada: " + CStr(Format(datadoc, "mm/dd/yyyy"))